import sys

def fl(x):
    try:
        float(x)
        return True
    except ValueError:
        return False

def ysf(x):
    oper = ["+" , "-" , "*" , "/"]
    return True if x in oper else False

def szh(x):
    e = []
    p = ""
    for i in x:
        if fl(i):
            p = p + i
        else:
            if p != "":
                e.append(p)
                p = ""
            e.append(i)
    if p != "":
        e.append(p)
    return e

def jj(x,y,c):
    a = float(x)
    b = float(y)
    if c == "+":
        x = a+b
    elif c == "-":
        x = a-b
    elif c == "*":
        x = a*b
    elif c == "/":
        x = a/b
    return x

def kh(x):
    a = -1
    b = 0
    while len(x) > a:
        if fl(x[a]) == False:
            return b
        elif ysf(x[a]):
            return -1
        else:
            b -= 1
        a -= 1


    

i = "("+sys.argv[1]+")"
s = szh(i)
left = [] #数字
right = [] #符号



for x in s:
    if fl(x):
        left.append(x)
    elif ysf(x):
        right.insert(0,x)
    elif x == ")":
        #print(")")
        while True:
           # print(right)
            #print(left)
            if left[-2] != "(":
                k = kh(left)
                if k+2 == 0:
                    left.append(jj(left.pop(k),left.pop(k+1),right.pop(abs(k+2))))
                else:
                    left.insert(k+2,jj(left.pop(k),left.pop(k+1),right.pop(abs(k+2))))
                #print(k)
                #print(right)
                #print(left)
                #print("----")
            else:
                left.pop(kh(left)-1)
                break
    elif x == "(":
        left.append(x)
    #print(right)
    #print(left)
    #print("----")
print(float(left.pop()))
